<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/common.jsp"%>
<link rel="stylesheet" href="${ctx}/page/include/css/topicItem.css" />

<title>搜索结果</title>
</head>
<body>
		<%@ include file="../common/header.jsp"%>
		<div class="container">
			<div class="row">
				<div class="col-md-6">
					<div class="panel panel-default">
						<div class="panel-heading">
							搜索到的话题
						</div>

						<div class="panel-body  paginate-bot">
						<c:choose>
							<c:when test="${searchResult.topics eq null || searchResult.topics.size() eq 0}">
								未搜索到数据
							</c:when>
							<c:otherwise>
								<c:forEach items="${searchResult.topics}" var="topic">
									<div class="media">
										<div class="media-left">
											<img onerror="this.src='${ctx}/static/imgs/avatar.jpg'" src="${topic.member.avatar}" class="avatar">
										</div>
										<div class="media-body">
											<a class="title" href="${ctx}/topic/${topic.id}"><p class="media-heading">${topic.title}</p></a>
											<span class="label label-info">${topic.section.name}</span>
											<span class="hidden-sm hidden-xs tInfo">${topic.member.name}</span> 
											<span class="hidden-sm hidden-xs tInfo">•</span> 
											<span class="hidden-sm hidden-xs tInfo">${topic.replyCounts}条回复</span> 
											<span class="hidden-sm hidden-xs tInfo">•</span> 
											<span class="hidden-sm hidden-xs tInfo">${topic.viewCounts}次浏览</span> 
											<span class="tInfo">•</span> 
											<span class="tInfo">${topic.formatDate(topic.createTime)}</span>
										</div>
									</div>
									<div class="divide"></div>
								</c:forEach>
							</c:otherwise>
						</c:choose>
						</div>
					</div>
				</div>
				<div class="col-md-6 hidden-sm hidden-xs">
					<div class="panel panel-default">
						<div class="panel-heading">
							搜索到的商品
						</div>
						<div class="panel-body  paginate-bot">
						<c:choose>
							<c:when test="${searchResult.products eq null || searchResult.products.size() eq 0}">
								未搜索到数据
							</c:when>
							<c:otherwise>
								<c:forEach items="${searchResult.products}" var="product">
									<div class="media">
										<div class="media-left media-middle">
											<a href="${ctx}/product/${product.id}"> 
												<img src="${product.smallImage}" class="avatar">
											</a>
										</div>
										<div class="media-body media-middle">
											<a style="color: #333" class="title" href="${ctx}/product/${product.id}">
												<h5 class="media-heading">${product.name}</h5>
											</a>
										</div>
									</div>
									<div class="divide"></div>
								</c:forEach>
							</c:otherwise>
						</c:choose>
						</div>
					</div>
				</div>
			</div>
		</div>
		<%@ include file="../common/footer.jsp"%>
</body>
</html>